<template>
  <div>
    <el-container style="border: 1px solid #eee;height:100vh">
      <el-aside style="background-color: rgb(48, 65, 86);" ref="aside" width="200">
        <el-menu default-active="1-4-1" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose" :collapse="isCollapse">
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-user-solid"></i>
              <span slot="title">用户管理</span>
            </template>
            <el-submenu index="1-1">
              <span slot="title">选项4</span>
              <el-menu-item index="1-1-1">选项1</el-menu-item>
            </el-submenu>
          </el-submenu>
          <el-menu-item index="2">
            <i class="el-icon-s-custom"></i>
            <span slot="title">角色管理</span>
          </el-menu-item>
          <el-menu-item index="3" disabled>
            <i class="el-icon-menu"></i>
            <span slot="title">菜单管理</span>
          </el-menu-item>
          <el-menu-item index="4">
            <i class="el-icon-setting"></i>
            <span slot="title">岗位管理</span>
          </el-menu-item>
          <el-menu-item index="5">
            <i class="el-icon-document-copy"></i>
            <span slot="title">字典管理</span>
          </el-menu-item>
          <el-menu-item index="6">
            <i class="el-icon-edit"></i>
            <span slot="title">参数设置</span>
          </el-menu-item>
          <el-menu-item index="7">
            <i class="el-icon-chat-dot-round"></i>
            <span slot="title">通知公告</span>
          </el-menu-item>
          <el-menu-item index="8">
            <i class="el-icon-edit-outline"></i>
            <span slot="title">日志管理</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      
      <el-container>
        <el-header style="font-size: 16px;color:#999093">
          <div style="float:left">
            <span style="float: left; margin-right:20px"> 
              <i class="el-icon-s-fold" v-if="isCollapse" @click="handelIcon"></i>
              <i class="el-icon-s-unfold" v-else @click="handelIcon"></i>
            </span>
            <span style="margin-right:20px"> <i class="el-icon-setting"></i>系统管理</span>
            <span style="margin-right:20px"> <i class="el-icon-setting"></i>系统监控</span>
            <span style="margin-right:20px"> <i class="el-icon-setting"></i>系统工具</span>
            <span style="margin-right:20px"> <i class="el-icon-setting"></i>若依官网</span>
            <span> <i class="el-icon-setting"></i>统计报表</span>
          </div>
          <div style="float: right;">
            <el-dropdown>
              <i class="el-icon-setting" style="margin-right: 15px"></i>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>查看</el-dropdown-item>
                <el-dropdown-item>新增</el-dropdown-item>
                <el-dropdown-item>删除</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
            <span>王小虎</span>
          </div>
        </el-header>
        
        <el-main>
          <el-table :data="tableData">
            <el-table-column prop="date" label="日期" width="140">
            </el-table-column>
            <el-table-column prop="name" label="姓名" width="120">
            </el-table-column>
            <el-table-column prop="address" label="地址">
            </el-table-column>
          </el-table>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  data(){
     const item = {
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      };
      return {
        tableData: Array(5).fill(item),
        isCollapse: true
      }
  },
  mounted(){
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
    handelIcon(){
      this.isCollapse = !this.isCollapse
    }
  }

}
</script>

<style lang="less" scoped>
 .el-header {
    background-color: #B3C0D1;
    color: #333;
    line-height: 60px;
  }
  
  .el-aside {
    color: #fff !important;

  }

  .el-menu-vertical-demo:not(.el-menu--collapse) {
    width: 200px;
    min-height: 400px;
    background-color: rgb(48, 65, 86);
  }
</style>